<template>
  <swiper v-if="banners">
        <swiper-item v-for="(item,index) in banners" :key="index" >
          <a :href="item.link">
            <img :src="item.image" alt="" @load="swiperImgLoad">
          </a>
        </swiper-item>
      </swiper>
</template>

<script>
import {Swiper,SwiperItem} from 'components/common/swiper/index.js'
export default {
    props:{
        banners:{
            type:Array,
            default(){
                return []
            }
        }
        
    },
    data(){
      return {
        isShow:false
      }
    },
    name:'homeSwiper',
    components:{
        Swiper,
        SwiperItem
    },
    methods:{
      swiperImgLoad(){
        if(!this.isShow){
          this.$emit("SwiperImgLoad")
          this.isShow=true;
        }
        
      }
    }
}
</script>

<style>

</style>